package com.bjpowernode.pmes.web.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * 服务器启动监听器监听人数
 * @author Administrator
 *
 */
public class ServerPersonListener implements HttpSessionListener {

	private int userNumber = 0;
	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		 userNumber++;
	     arg0.getSession().setAttribute("userNumber", userNumber);
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		userNumber--;
        arg0.getSession().setAttribute("userNumber", userNumber);
	}
}
